package yunquan.wang.base.report;

import net.sf.dynamicreports.report.base.expression.AbstractValueFormatter;
import net.sf.dynamicreports.report.definition.ReportParameters;
import yunquan.wang.base.appcode.AppcodeHolder;

public class CodeValueFormatter extends AbstractValueFormatter {

	private String codeType;
	
	public CodeValueFormatter(String codeType)
	{
		this.codeType=codeType;
	}
	@Override
	public Object format(Object value, ReportParameters reportParameters) {
		if(value!=null)
	  return	AppcodeHolder.getCodeValue(codeType, value.toString());
		return null;
	}

}
